<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="../../../statics/xadmin/css/font.css">
    <link rel="stylesheet" href="../../../statics/xadmin/css/xadmin.css">
    <link rel="stylesheet" href="../../../statics/ceber/css/mardown-css-jwsky.css">
    <link rel="stylesheet" href="../../../statics/ceber/css/highlight/arduino-light.css">

    <script type="text/javascript" src="../../../statics/xadmin/js/jquery.min.js"></script>
    <script src="../../../statics/xadmin/lib/layui/layui.js" charset="utf-8"></script>
    <script src="../../../statics/ceber/js/showdown.min.js" charset="utf-8"></script>
    <script src="../../../statics/ceber/js/ceber.js" charset="utf-8"></script>
    <script src="../../../statics/ceber/js/highlight.pack.js" charset="utf-8"></script>

    <style>
        .layui-tab-content {
            padding: 0px;
            padding-top: 10px;
        }

        input {
            margin-bottom: 10px;
        }
    </style>
</head>
<body>
<div class="x-body layui-anim layui-anim-up">
    <blockquote class="layui-elem-quote">基本命令注入</blockquote>
    <fieldset class="layui-elem-field">
        <legend>题目区</legend>
        <div class="layui-field-box">
            <div class="layui-row" style="vertical-align:bottom">
                <form class="layui-form" method="POST" name="form"
                      action="/ceber-range/otherinjection/command1">
                    <input type="text" name="ip" placeholder="请输入ip" autocomplete="off" class="layui-input">
                    <button type="button" class="layui-btn layui-btn-mini" onclick="ceberSubmit(this);">Ping</button>
                </form>
            </div>
            <div class="layui-row" id="rs-message">
            </div>
            <div class="layui-row" id="rs-body">
            </div>
            <div class="layui-row" id="rs-hit">
            </div>
            <div class="layui-row" id="rs-bak">
            </div>
        </div>
    </fieldset>
    <fieldset class="layui-elem-field">
        <legend>解题区</legend>
        <div class="layui-tab layui-field-box">
            <ul class="layui-tab-title">
                <li class="layui-this">描述</li>
                <li>提示</li>
                <li>源代码</li>
                <li>攻击方法</li>
                <li>防御</li>
            </ul>
            <div class="layui-tab-content">
                <div class="layui-tab-item layui-show" id="mubiao">描述</div>
                <div class="layui-tab-item" id="tishi">提示</div>
                <div class="layui-tab-item" id="yuandaima">源代码</div>
                <div class="layui-tab-item" id="gongjifangfa">攻击方法</div>
                <div class="layui-tab-item" id="fangyu">防御</div>
            </div>
        </div>
    </fieldset>

    <code id="mubiao_source" style="display:none">
        <script type='text/html' style='display:block'>
            命令注入

        </script>
        <
        /code>

        < code
        id = "tishi_source"
        style = "display:none" >
            < script
        type = 'text/html'
        style = 'display:block' >


        </script>
    </code>

    <code id="yuandaima_source" style="display:none">
        <script type='text/html' style='display:block'>
            ```
            public static ResponeStruct ping(String ipAddress) {
            ResponeStruct rStruct = new ResponeStruct();
            StringBuffer sb = new StringBuffer();
            String line = null;
            try {
            String[] cmd = new String[3];
            if(System.getProperty("os.name").indexOf("indow") >= 0) {
            cmd = new String[] { "cmd.exe", "/c", " ping " + ipAddress };
            }else {
            cmd = new String[] { "/bin/sh", "-c", "ping -c 4 " + ipAddress };
            }
            Process pro = Runtime.getRuntime().exec(cmd);
            BufferedReader buf = new BufferedReader(new InputStreamReader(pro.getInputStream()));
            while ((line = buf.readLine()) != null)
            sb.append(line + "<br/>");
            rStruct.setCode(1);
            rStruct.setMessage("ping成功");
            rStruct.setBody(sb.toString());
            return rStruct;
            } catch (Exception ex) {
            rStruct.setCode(0);
            rStruct.setMessage("ping失败");
            rStruct.setBody(ex.getMessage());
            return rStruct;
            }
            }
            ```

        </script>
        <
        /code>

        < code
        id = "gongjifangfa_source"
        style = "display:none" >
            < script
        type = 'text/html'
        style = 'display:block' >
            ```
1.1.1.1 && pwd
```
        </script>
    </code>

    <code id="fangyu_source" style="display:none">
        <script type='text/html' style='display:block'>


        </script>
        <
        /code>
        < blockquote
        class
        = "layui-elem-quote layui-quote-nm" > 持续集成 < /blockquote>
            < /div>
            < /body>

            < script >
            $(function () {
                //加载弹出层
                layui.use(['form', 'element'],
                    function () {
                        layer = layui.layer;
                        element = layui.element;
                    });
                var converter = new showdown.Converter();
                $("#mubiao").html(converter.makeHtml($("#mubiao_source").html().substr(48)));
                $("#tishi").html(converter.makeHtml($("#tishi_source").html().substr(48)));
                $("#yuandaima").html(converter.makeHtml($("#yuandaima_source").html().substr(48)));
                $("#gongjifangfa").html(converter.makeHtml($("#gongjifangfa_source").html().substr(48)));
                $("#fangyu").html(converter.makeHtml($("#fangyu_source").html().substr(48)));
            });

        $(document).ready(function () {
            $('pre code').each(function (i, block) {
                hljs.highlightBlock(block);
            });
        });
        </script>
</html>